<?php

class tsw_todaysRain implements ThermdSingleWidget
{
  public function drawWidget($io,$x,$y)
  {	
 
		$todaysrain = ThermdStats::ts_totalRainfallPeriod(secondsSinceMidnight());
		$black = imagecolorallocate($io,0,0,0);
		if($todaysrain===FALSE)
		{
			$todaysrain = "-- ";
		}
		// x = 522, y = 139
		imagestring($io,3,$x,$y,"Today's Rainfall",$black);
		$cbimg = imagecreatefrompng(ThermdStats::$thermosrc.'rf.png');
		imagecopy($io,$cbimg,$x+3,$y+26,0,0,20,20);
		imagestring($io,4,$x+48,$y+21,$todaysrain.ThermdStats::$rainunits,$black);
		imagestring($io,2,$x+28,$y+37,"Now @ ".ThermdStats::ts_rainRate().ThermdStats::$rainunits."/hr",$black);
  }
}

?>